Skip to content

Conversation

@strongduanmu
Copy link
Member

@mihaibudiu
Copy link
Contributor

Let me know when this is ready for review

@strongduanmu
Copy link
Member Author

Hi @mihaibudiu, thank you for your attention to this PR. I have some questions about JDBC Adapter testing. In order to test MySQL UNSIGNED types, I need to create a table in MySQL that contains UNSIGNED types of TINYINT, SMALLINT, INT, BIGINT, but I find it difficult to add a table in JdbcTest or JdbcAdapterTest.

Do you have experience with similar testing, I would really appreciate it if you could provide some help.

@strongduanmu
Copy link
Member Author

In addition, I tested the MySQL UNSIGNED types locally by writing a Calcite JDBC Demo. These types can be returned normally without throwing a NumberOutOfRange exception.

08:55:37.989 [main] INFO com.strongduanmu.database.mysql.MySQLUnsignedTypeDev - ColumnLabel: tiny_id, ColumnValue: 255
08:55:37.989 [main] INFO com.strongduanmu.database.mysql.MySQLUnsignedTypeDev - ColumnLabel: small_id, ColumnValue: 65535
08:55:37.989 [main] INFO com.strongduanmu.database.mysql.MySQLUnsignedTypeDev - ColumnLabel: medium_id, ColumnValue: 16777215
08:55:37.989 [main] INFO com.strongduanmu.database.mysql.MySQLUnsignedTypeDev - ColumnLabel: int_id, ColumnValue: 4294967295
08:55:37.989 [main] INFO com.strongduanmu.database.mysql.MySQLUnsignedTypeDev - ColumnLabel: big_id, ColumnValue: 18446744073709551615

@mihaibudiu
Copy link
Contributor

This is a good question: what is the semantics of various operations on unsigned numbers?
There are multiple choices.
This one is probably better than the one I have implemented in my PR.
You should file an issue for Calcite about the meaning of unary minus for unsigned numbers.

@mihaibudiu
Copy link
Contributor

I have never written tests that involve JDBC in Calcite directly.
My guess is that these tables come from CalciteAssert - these ConnectionSpec values.

@xiedeyantu
Copy link
Member

You can refer to MY_DB_SCHEMA to construct the column about unsigned.

@strongduanmu
Copy link
Member Author

You can refer to MY_DB_SCHEMA to construct the column about unsigned.

Thank you for your remind.

@github-actions
Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jul 26, 2025
@mihaibudiu
Copy link
Contributor

Do you plan to continue this work?

@github-actions github-actions bot removed the stale label Jul 29, 2025
@strongduanmu
Copy link
Member Author

Do you plan to continue this work?

Hi @mihaibudiu @xiedeyantu , I have add jdbc test for MySQL unsigned type, it can execute successfully on mysql local machine with avatica 1.27.0-SNAPSHOT.

@strongduanmu
Copy link
Member Author

strongduanmu commented Aug 21, 2025

Could you please help merge apache/calcite-avatica#275? After avatica is released, I will replace avatica in calcite with the release version and then merge this PR.

@strongduanmu
Copy link
Member Author

Hi @mihaibudiu @xiedeyantu, could you please review this PR? I have upgraded calcite.avatica.version to 1.27.0. Thank you very much.

@rubenada
Copy link
Contributor

I think we should keep Avatica upgrade separately, done via its dedicated ticket CALCITE-7183
@strongduanmu you can create a separate PR specifically for that, and then once it is merged, re-sychronized this one.
Sorry if this is a bit inconvenient, but I think we should keep things organized.

@xiedeyantu
Copy link
Member

I submitted this PR #4564

@strongduanmu
Copy link
Member Author

#4564

Thank you @rubenada for your suggestion, I'll pay attention next time. Thanks @xiedeyantu for submitting the PR.

@xiedeyantu
Copy link
Member

It seems something went wrong with the CI. I reran all the CI jobs to see if they pass.

@mihaibudiu
Copy link
Contributor

Please rebase on main and ask for a new review when ready

@strongduanmu
Copy link
Member Author

Please rebase on main and ask for a new review when ready

Hi @mihaibudiu, I have rebased on main, thanks to @xiedeyantu for helping with rerun, and now CI has passed.

@mihaibudiu mihaibudiu added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Oct 1, 2025
…UNSIGNED types of TINYINT, SMALLINT, INT, BIGINT
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2025

@mihaibudiu mihaibudiu merged commit a1caa65 into apache:main Oct 2, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants